import request from '@/config/axios'

/**
 * 新增项目版本
 */
export const create = (data) => {
  return request.post({ url: '/infra/devops/project-version/create', data })
}

/**
 * 更新项目版本
 */
export const update = (data) => {
  return request.put({ url: '/infra/devops/project-version/update', data })
}

/**
 * 删除客户版本
 */
export const deleted = (id) => {
  return request.delete({ url: '/infra/devops/project-version/deleted?id=' + id })
}

/**
 * 获取单个客户版本
 */
export const singleGet = (id) => {
  return request.get({ url: '/infra/devops/project-version/single-get?id=' + id })
}

/**
 * 分页查询项目版本
 */
export const pageQuery = (params) => {
  return request.get({ url: '/infra/devops/project-version/page-query', params })
}

/**
 * 根据项目获取项目的所有版本
 */
export const getByProject = (projectId) => {
  return request.post({
    url: '/infra/devops/project-version/get-by-project?projectId=' + projectId
  })
}
